package vip.web3.common.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 *  交易状态描述
 */
@Getter
@RequiredArgsConstructor
public enum TransactionTypeEnum {
    /** 充值 */
    RECHARGE(1, "充值"),

    /** 提币 */
    WITHDRAW(2, "提币"),

    /** 转账 */
    TRANSFER(3, "转账"),

    /** 闪兑 */
    FLUSH (4, "闪兑(USDT-DS.C"),

    ;

    private final int type;
    private final String desc;

    /**
     * 根据传入的状态获取描述信息
     * @param type
     * @return
     */
    public static String getDescByType(int type) {
        for (TransactionTypeEnum statusEnum : TransactionTypeEnum.values()) {
            if (statusEnum.getType() == type) {
                return statusEnum.getDesc();
            }
        }
        return null;
    }

}